// pages/feed/index.js
var util = require('../../utils/util.js')
Page({
  data: {
    articles: []
  },
  onLoad: function () {
    var that = this;
    wx.request({
      url: 'https://task.congcong.us/api/wechat/articles',
      data: {
        
      },
      header: {
        'Content-Type': 'application/json'
      },
      success: function (res) {
        if (res.data.code == 9999) {
          console.log(res.data.result)
          var test = res.data.result
          that.setData({
            articles: test
          })
        } else {
          console.log('获取失败');
        }
      }
    }) 
  },
  //事件处理函数
  bindViewTap: function (event) {
    wx.navigateTo({
      url: '../article/view?article_id=' + event.currentTarget.dataset.article_id + '&article_sub_id=' + event.currentTarget.dataset.article_sub_id
    })
  }, 
})